

<%@page contentType="text/html" pageEncoding="UTF-8" import="Modelo.*, java.util.*"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<%@page import = "java.util.*" %>
<%@page import = "Modelo.*" %>
<%@page import = "javax.swing.*" %>

<jsp:useBean id="proyecto" scope="request" class="Modelo.Proyecto" />
<%
//esto es para que no guarde en el cache la pagina
            response.setHeader("Cache-Control", "max-age=0");
            response.setHeader("Cache-Control", "no-cache");
            response.setHeader("Cache-Control", "no-store");
            response.setHeader("Pragma", "no-cache");
            response.setDateHeader("Expires", -1);
%>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>Autoevaluacion</title>
        <link href="<%=request.getContextPath()%>/css/style.css" rel="stylesheet" type="text/css" media="screen" />
        <link type="text/css" href="<%=request.getContextPath()%>/jQuery/css/custom-theme/jquery-ui-1.8.4.custom.css" rel="Stylesheet" />
        <script type="text/javascript" src="<%=request.getContextPath()%>/jQuery/js/jquery-1.3.2.min.js"></script>
        <script type="text/javascript" src="<%=request.getContextPath()%>/jQuery/js/jquery-ui-1.7.2.custom.min.js"></script>
        <style type="text/css" title="currentStyle">
            @import "<%=request.getContextPath()%>/jQuery/DataTables-1.7.1/media/css/demo_page.css";
            @import "<%=request.getContextPath()%>/jQuery/DataTables-1.7.1/media/css/demo_table_jui.css";
            @import "<%=request.getContextPath()%>/jQuery/DataTables-1.7.1/examples/examples_support/themes/smoothness/jquery-ui-1.7.2.custom.css";
        </style>
        <script type="text/javascript" language="javascript" src="<%=request.getContextPath()%>/jQuery/DataTables-1.7.1/media/js/jquery.js"></script>
        <script type="text/javascript" language="javascript" src="<%=request.getContextPath()%>/jQuery/DataTables-1.7.1/media/js/jquery.dataTables.js"></script>
        <script type="text/javascript" charset="utf-8">
            $(document).ready(function() {
                oTable = $('#example').dataTable({
                    "bJQueryUI": true,
                    "sPaginationType": "full_numbers"
                });
            } );
        </script>
    </head>

    <body>
        <%
        HttpSession s = request.getSession();
        if (s.getAttribute("logged") != null && s.getAttribute("logged").equals(true)) {
            Representante rrr = (Representante) s.getAttribute("representante");



            Encuesta en = new Encuesta();

            List l = en.getLista();

            if (l.size() != 0) {
        %>



        <div style="height: 400px" >
            <h3>Listado de Encuestas</h3>
            <!-- tabla-->
            <table  cellpadding="0" cellspacing="0" border="0" class="display" id="example">
                <thead>
                    <tr>
                        <th>Encuesta</th>
                        <th>Descripcion</th>
                        <th>Mensaje Inicial</th>
                        <th></th>

                    </tr>
                </thead>
                <tbody>
                    <%


                                                                                        Iterator it = l.iterator();
                                                                                        while (it.hasNext()) {
                                                                                            en = (Encuesta) it.next();
                    %>
                    <tr>
                        <td><%=en.getNombre()%></td>
                        <td><%=en.getDescripcion()%></td>
                        <td><%=en.getMensaje()%></td>
                        <td width="65px"><a href="<%=request.getContextPath() + "/encuesta/detalle.jsp?iden=" + en.getId()%>"><img src="<%=request.getContextPath()%>/images/zoom.png"  style="border:0" title="Ver"/></a>&nbsp;
                            <a href="<%=request.getContextPath() + "/encuesta/editar.jsp?iden=" + en.getId()%>"><img src="<%=request.getContextPath()%>/images/delete.png"  style="border:0" title="Editar"/></a>&nbsp;
                        <a href="<%=request.getContextPath() + "/encuesta/vistaPrevia.jsp?iden=" + en.getId()%>"><img src="<%=request.getContextPath()%>/images/eye.png"  style="border:0" title="Vista Previa"/></a></td>
                    </tr>

                    <%
                    }
                    %>
                </tbody>
            </table>
            <%
            } else {
            %>
            <h3> No Existen Encuestas Registradas </h3>


            <%                                                            }
            %>
            <!--/tabla-->
        </div>


        <%} else {
        response.sendRedirect(request.getContextPath() + "/index.jsp");
    }%>
    </body>
</html>

